
public class Sphere {

	private double radius, xCenter, yCenter;

	public Sphere(double radius, double xCenter, double yCenter) throws IllegalArgumentException {
		if (radius < 0)
			throw new IllegalArgumentException("Error : radius < 0");

		this.radius = radius;
		this.xCenter = xCenter;
		this.yCenter = yCenter;

	}

	public double getRadius() {
		return radius;

	}

	public double getX() {
		return xCenter;

	}

	public double getY() {
		return yCenter;

	}

	public void setX(double xCenter) {
		this.xCenter = xCenter;

	}

	public void setY(double yCenter) {
		this.yCenter = yCenter;
	}

	public void setRadius(double radius) throws IllegalArgumentException {
		if (radius < 0)
			throw new IllegalArgumentException("Error : radius < 0");
		this.radius = radius;

	}

	public double calVolume() {

		return (4 / 3.0) * Math.PI * Math.pow(radius, 3);

	}

	public double calSA() {

		return (4) * Math.PI * Math.pow(radius, 2);
	}

}